import {http} from '@/utils/http'

enum Api {
    findAllSysMenuTreeList = '/sys/menu/findAllSysMenuTreeList',
    findSysMenuTreeListByEnable = '/sys/menu/findSysMenuTreeListByEnable',
    findNavMenuTreeListByCurrentUser = '/sys/menu/findNavMenuTreeListByCurrentUser',
    addSysMenu = '/sys/menu/insert',
    getSysMenu = '/sys/menu/findById/',
    updateSysMenu = '/sys/menu/update',
    deleteSysMenu = '/sys/menu/deleteById/',
}

/** 菜单*/
// 获取所有的系统菜单树形列表
export function findAllSysMenuTreeList(data:any) {
    return http.get<any>(Api.findAllSysMenuTreeList, data)
}
// 获取当前用户的导航菜单
export function findNavMenuTreeListByCurrentUser(data:any) {
    return http.get<any>(Api.findNavMenuTreeListByCurrentUser, data)
}
// 获取启用的系统菜单树形列表
export function findSysMenuTreeListByEnable(data:any) {
    return http.get<any>(Api.findSysMenuTreeListByEnable, data)
}
// 添加菜单
export function addSysMenu(data:any) {
    return http.post<any>(Api.addSysMenu,data)
}
// 菜单详情
export function getSysMenu(id:string|number) {
    return http.get<any>(
        Api.getSysMenu+id)
}
// 修改菜单
export function updateSysMenu(data:any) {
    return http.post<any>(Api.updateSysMenu,data)
}
// 删除菜单
export function deleteSysMenu(id:string|number) {
    return http.post<any>(Api.deleteSysMenu+id)
}














